package com.di.base.feign.service.impl;

import com.di.base.common.dto.StorageRequestDTO;
import com.di.base.common.exception.BusinessException;
import com.di.base.feign.StorageFeignClient;
import com.di.base.feign.service.StorageFeignService;
import feign.FeignException;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


@Service("storageFeignService")
public class StorageFeignServiceImpl implements StorageFeignService {
    @Resource
    private StorageFeignClient storageFeignClient;

    @Override
    public void decrease(StorageRequestDTO request) {
        try {
            storageFeignClient.decrease(request);
        } catch (FeignException e) {
            throw e;
        }
    }

    @Override
    public void increase(StorageRequestDTO request) {
        try {
            storageFeignClient.increase(request);
        } catch (FeignException e) {
            throw e;
        }
    }

    @Override
    public void test(StorageRequestDTO request) {
        try {
            storageFeignClient.test(request);
        } catch (FeignException e) {
            throw e;
        }
    }
}